package com.tbit.uqbike.center.util;

import java.math.RoundingMode;
import java.text.DecimalFormat;

public class NumberUtils {
    static DecimalFormat df = new DecimalFormat("#.00");

    static {
        df.setMaximumFractionDigits(2);
        df.setGroupingSize(0);
        df.setRoundingMode(RoundingMode.FLOOR);
    }

    /**
     * 格式化(不需要四舍五入)
     *
     * @param value
     * @return float
     */
    public static String round(Number value) {
        return df.format(value);
    }
}
